<template>
  <div>
    <!-- 账号信息 -->
    <SectionContainer class="u-p20 u-mb40">
      <el-form label-width="160px">
        <!--账号信息-->
        <SectionTitle class="u-mb30">账号信息</SectionTitle>
        <div class="u-pb20">
          <el-form-item label="账户名称">{{baseData.accountName}}</el-form-item>
          <el-form-item label="登录账号">{{baseData.username}}</el-form-item>
          <el-form-item label="角色">{{baseData.roleName}}</el-form-item>
          <el-form-item label="账号状态">{{baseData.accountStatus}}</el-form-item>
        </div>
      </el-form>
    </SectionContainer>
  </div>
</template>

<script>
import SectionTitle from "@/components/section-title";
import SectionContainer from "@/components/section-container";

import { fetchAccountAdminDetail } from "@/api";

export default {
  components: {
    SectionTitle,
    SectionContainer
  },
  data() {
    return {
      baseData: {}
    };
  },
  methods: {
    // 获取账户信息
    fetchAccountAdminDetail() {
      fetchAccountAdminDetail({
        query: {
          userId: this.$route.query.userId
        }
      }).then(res => {
        this.baseData = res.data;
      });
    }
  },
  created() {
    this.fetchAccountAdminDetail();
  }
};
</script>